package com.ecommerce.model;

import java.util.Date;
import java.util.List;

public class SalesReport {
    private Date startDate;
    private Date endDate;
    private double totalRevenue;
    private int totalOrders;
    private int totalProductsSold;
    private List<ProductSales> productSales;
    private List<CategorySales> categorySales;

    public SalesReport() {}

    // Getters and Setters
    public Date getStartDate() { return startDate; }
    public void setStartDate(Date startDate) { this.startDate = startDate; }

    public Date getEndDate() { return endDate; }
    public void setEndDate(Date endDate) { this.endDate = endDate; }

    public double getTotalRevenue() { return totalRevenue; }
    public void setTotalRevenue(double totalRevenue) { this.totalRevenue = totalRevenue; }

    public int getTotalOrders() { return totalOrders; }
    public void setTotalOrders(int totalOrders) { this.totalOrders = totalOrders; }

    public int getTotalProductsSold() { return totalProductsSold; }
    public void setTotalProductsSold(int totalProductsSold) { this.totalProductsSold = totalProductsSold; }

    public List<ProductSales> getProductSales() { return productSales; }
    public void setProductSales(List<ProductSales> productSales) { this.productSales = productSales; }

    public List<CategorySales> getCategorySales() { return categorySales; }
    public void setCategorySales(List<CategorySales> categorySales) { this.categorySales = categorySales; }

    @Override
    public String toString() {
        return String.format("统计期间: %s 至 %s | 总营收: ¥%.2f | 订单数: %d | 商品销量: %d",
                startDate, endDate, totalRevenue, totalOrders, totalProductsSold);
    }
}